//
//  GKZYMajorDetailTopView.m
//  GKZYAid
//
//  Created by tony on 16/3/6.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "GKZYMajorDetailTopView.h"
#import "MyDefine.h"

@interface GKZYMajorDetailTopView ()

@property(nonatomic,strong)UILabel *name;
@property(nonatomic,strong)UILabel *code;

@end


@implementation GKZYMajorDetailTopView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addViews];
    }
    return self;
}


-(void)addViews{
    
    self.image = [[UIImageView alloc]initWithFrame:self.frame];
    self.image.image = [UIImage imageNamed:@"1"];
    [self addSubview:self.image];
    
    self.name = [[UILabel alloc]initWithFrame:CGRectMake(0, VIEWHEIGHT/3, VIEWWIDTH, 20)];
    self.name.backgroundColor = [UIColor clearColor];
    self.name.textAlignment = NSTextAlignmentCenter;
    self.name.textColor = [UIColor whiteColor];
    self.name.font = [UIFont systemFontOfSize:20];
    [self addSubview:self.name];
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(VIEWWIDTH/4, VIEWHEIGHT/2, VIEWWIDTH*0.5, 2)];
    label.backgroundColor = [UIColor whiteColor];
    [self addSubview:label];
    
    self.code = [[UILabel alloc]initWithFrame:CGRectMake(0, VIEWHEIGHT*11/20, VIEWWIDTH, VIEWHEIGHT/5)];
    _code.textAlignment = NSTextAlignmentCenter;
    _code.textColor = [UIColor whiteColor];
    _code.font = [UIFont systemFontOfSize:14];
    [self addSubview:self.code];

}

-(void)setTheMajorName:(NSString *)name andCode:(NSString *)code{

    self.name.text = name;
    NSString *string = [NSString stringWithFormat:@"专业代码： %@",code];
    self.code.text  = string;

}


@end
